﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Target = KC.Business.Net;

namespace KC.Tests.Business.Net
{
	[TestClass]
	public class Mail : Target.Mail
	{
		const string
			Recipient = "kevin@kconnolly.net",
			Subject = "Automated Test Message";

		[TestMethod]
		[Timeout(120000)]
		[TestCategory("Internet")]
		public void SendMailTest()
		{
			Target.Mail.SendMail(Recipient, Subject + DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss"), "This is an automated message sent by an Internet Integration Test.");
			Assert.Inconclusive("There is no way to verify the result of this programmatically");
		}
		[TestMethod]
		[TestCategory("Unit")]
		[ExpectedException(typeof(ArgumentNullException))]
		public void SendMailNullTest1()
		{
			Target.Mail.SendMail(null, Subject + DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss"), "This is an automated message sent by an Internet Integration Test.");
		}
		[TestMethod]
		[TestCategory("Unit")]
		[ExpectedException(typeof(ArgumentNullException))]
		public void SendMailNullTest2()
		{
			Target.Mail.SendMail(Recipient, null, "This is an automated message sent by an Internet Integration Test.");
		}
		[TestMethod]
		[TestCategory("Unit")]
		[ExpectedException(typeof(ArgumentNullException))]
		public void SendMailNullTest3()
		{
			Target.Mail.SendMail(Recipient, Subject + DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss"), null);
		}

	}
	
	
}